.org 0xE6778 ; Capture Increase

Capture_Increase:

	PUSH 	{R4-R6, LR}
	
	MOV		R6, 0								; Capture bonus = 0
	
;-------------------------------------------------------------------------------
	
	LDR 	R3, [Capture_Increase_1]
	LDR 	R2, [Capture_Increase_2]	
	LDR 	R4, [R3, 0]
	LDR 	R3, [R2, 0]	
	
	MOV 	R2, 0x98		
	ADD 	R3, R4, R3, LSL 2
	MUL		R5, R0, R2
	LDR		R3, [R3, 0x48]
	MOV		R4, R1, LSL 4
	ADD 	R0, R3, 0x5000
	LDR 	R0, [R0, 0xA58]	
	ADD 	R0, R0, R5
	ADD 	R0, R0, 0x74
	ADD		R0, R0, R1, LSL 4
	
	MOV 	R1, Rank_Invader					; Rank: Rank Invader
	
	BL 		Check_Skills_Equipped				; Check the Skill is equipped	
	CMP 	R0, 0								; Does CO use that skill?
	ADDNE 	R6, R6, Stats_Invader				; If CO use skill, increase capture
	
;-------------------------------------------------------------------------------
	
	BL		Skill_Setup_Type_2
	
	MOV 	R1, Rank_Conqueror					; Rank: Conqueror
	
	BL 		Check_Skills_Equipped				; Check the Skill is equipped	
	CMP 	R0, 0								; Does CO use that skill?
	ADDNE 	R6, R6, Stats_Conqueror				; If CO use skill, increase capture
	
;-------------------------------------------------------------------------------
	
	MOV 	R0, R6								; Total capture bonus
	
	POP 	{R4-R6, LR}	
	BX 		LR
	
;-------------------------------------------------------------------------------

	NOP
	NOP
	NOP	
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP		

;-------------------------------------------------------------------------------		

Capture_Increase_1:
	.dw Reg1_Skill
	
Capture_Increase_2:
	.dw Reg2_Skill



